package com.zou.szt;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.Button;

public class HomeActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home);

        initView();

    }

    private void initView() {
        Button b1 = (Button) findViewById(R.id.btn_check_money);
        Button b2 = (Button) findViewById(R.id.btn_weather);
        Button b3 = (Button) findViewById(R.id.btn_metro_price);
        b1.setOnClickListener(this);
        b2.setOnClickListener(this);
        b3.setOnClickListener(this);
    }


    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_check_money:
                startActivity(new Intent(this, MainActivity.class));
                break;
            case R.id.btn_weather:
                startActivity(new Intent(this, MainActivity.class));
                break;
            case R.id.btn_metro_price:
                startActivity(new Intent(this, PriceQueryActivity.class));
                break;
            default:
                break;
        }
    }
}
